#!/usr/bin/env node
const { program } = require("commander");
const helpOptions = require("./core/help-options");
const { createProjectAction, addComponentAction } = require("./core/actions");

// 1. 配置所有的options
helpOptions();

// 2. 增加具体的一些功能操作
program
  .command("create <project> [...options]")
  .description("create vue project into a folder，比如: whycli create airbo")
  .action(createProjectAction);

program
  .command("addcpn <cpnname> [...options]")
  .description(
    "add vue component into a folder, 比如 whycli addcpn NavBar -d src/components"
  )
  .action(addComponentAction);

// 让commander解析process.argv参数
program.parse(process.argv);
